

import seaborn as sns
import matplotlib.pyplot as plt
import pandas as pd
import numpy as np
import csv
import sys
import math



try:
    dados = pd.read_csv('SP_data.csv')
except:
    print ("File not found " + sys.argv[1])
    sys.exit (0);



#sns.set_style("whitegrid")

# make a plot
plt.plot(dados.Day, dados.New_cases, lw = 0.75, color="green", label='Original')

plt.xlabel("Day",fontsize=14)

plt.ylabel("Daily Cases",fontsize=14)

plt.plot(dados.Day, dados.Smoothed, lw = 1.5, color="blue", label='Smoothed')

plt.title ('Daily cases.', fontsize=18)
plt.legend()
plt.grid()

plt.subplots_adjust(
top=0.88,
bottom=0.12,
left=0.145,
right=0.92,
hspace=0.2,
wspace=0.2
)

ax = plt.gca()
for item in (\
             #[ax.title,ax.xaxis.label, ax.yaxis.label] + \
             ax.get_xticklabels() + ax.get_yticklabels()):
    item.set_fontsize(14)

for item in ax.get_legend().get_texts():
    item.set_fontsize(14)


plt.draw()

#plt.savefig('Figure-7a.eps', format='eps')
#plt.savefig('Figure-7a.png', dpi=400)

plt.show ()

#quit()


#==================================================================
plt.figure(2)


plt.plot(dados.Day, dados.Total_cases, lw = 1.0, color="green", label='Original')

plt.xlabel("Day",fontsize=14)

plt.ylabel("Total Cases",fontsize=14)

plt.plot(dados.Day, dados.Smoothed_t, lw = 1.5, color="blue", linestyle = 'dashed', label='Smoothed')

plt.title ('Total Cases', fontsize=18)
plt.legend()


plt.grid()

plt.subplots_adjust(
top=0.88,
bottom=0.12,
left=0.125,
right=0.9,
hspace=0.2,
wspace=0.2
)

ax = plt.gca()

sns.move_legend(ax, "center right")

for item in (\
             #[ax.title,ax.xaxis.label, ax.yaxis.label] + \
             ax.get_xticklabels() + ax.get_yticklabels()):
    item.set_fontsize(14)

for item in ax.get_legend().get_texts():
    item.set_fontsize(14)

plt.yscale ('log')

plt.draw()

#plt.savefig('Figure-7b.eps', format='eps')
#plt.savefig('Figure-7b.png', dpi=400)

plt.show()
